package ru.passivemoney.strategy;

import java.util.Map;
import java.util.Set;

import ru.passivemoney.strategy.processors.IProcessor;

import com.dukascopy.api.IBar;
import com.dukascopy.api.Instrument;
import com.dukascopy.api.Period;

public abstract class AStrategy {
	
	protected Map<Period, IProcessor> processors;
	private Instrument instrument;

	public AStrategy(Map<Period, IProcessor> processors) {
		this.processors = processors;
	}
	
	public abstract Prognosis processBar(Instrument instrument, Period period, IBar askBar, IBar bidBar);
	
	protected Map<Period, IProcessor> getProcessors() {
		return processors;
	}
	
	public Set<Period> getPeriods(){
		return processors.keySet();
	}
	
	public void initProcessors(){
		for(IProcessor p : processors.values()){
			p.init();
		}
	}

	public Instrument getInstrument() {
		return instrument;
	}

	public void setInstrument(Instrument instrument) {
		this.instrument = instrument;
	}

}
